<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" type="text/javascript" charset="utf-8"></script>
<script src="<?php echo MOBILE_RESOURCE_SITE_URL;?>/js/zepto.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
    wx.config(<?php echo $output['js']; ?>);
    wx.ready(function () {
        // 9.1.2 扫描二维码并返回结果
        wx.scanQRCode({
            needResult: 1,
            desc: 'scanQRCode desc',
            success: function (res) {
                //判断扫码是否成功
                if (res.errMsg == 'scanQRCode:ok') {
                    //扫码成功进行跳转
                    location.href=res.resultStr;
                } else {
                    alert('扫描失败，请稍后再试');
                }

            },
            cancel: function(){
                window.history.go(-1);
            }
        });
    });

    wx.error(function (res) {
        alert('参数错误');
    });
</script>